/**
 * Copyright &copy; 2013-2015 山东易科德软件有限公司 All rights reserved.
 */
package cn.net.ecode.modules.sys.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.net.ecode.common.service.TreeService;
import cn.net.ecode.modules.sys.dao.AreaDao;
import cn.net.ecode.modules.sys.entity.Area;
import cn.net.ecode.modules.sys.utils.UserUtils;

/**
 * 区域Service
 * @author ThinkGem/jiaoanjian
 * @version 2014-8-19
 */
@Service
@Transactional(readOnly = true)
public class AreaService extends TreeService<AreaDao, Area> {

	public Area get(String areaCode) {
		return super.get(areaCode);
	}

	public List<Area> findList(Area area) {
		return super.findList(area);
	}

	public List<Area> findAll() {
		return UserUtils.getAreaAllList();
	}

	@Transactional(readOnly = false)
	public void save(Area area) {
		super.save(area);
		UserUtils.removeCache(UserUtils.CACHE_AREA_ALL_LIST);
	}

	@Transactional(readOnly = false)
	public void delete(Area area) {
		super.delete(area);
		UserUtils.removeCache(UserUtils.CACHE_AREA_ALL_LIST);
	}

}
